#ifndef GRAINS_H
#define GRAINS_H
/**
 * grains.h
 * This holds the different values for the 
 * grains type nutrition_fields in coolinary.h
 */

#include "table.h"
#include "coolinary.h"
#define MAX 101

/**
 * Grain descriptions
 * Based on 1/4 cup dry grain
 */
void addGrains(table* g_table)
{
  struct nutrition_fields g_barley = {
	.calories = 160,
	.protein = 5.75,
	.sugar = 0,
	.fat = 1,
	.cholesterol = 0,
	.vitamin_a = 0,
	.vitamin_c = 0
  };

  cooltype barley = {
	.name = "barley",
	.type = "grain",
	.nutrition = 40,
	.nutrition_values = g_barley,
	.quantity = 1,
	.time = 0

  };

  struct nutrition_fields g_corn = {
	.calories = 152,
	.protein = 4,
	.sugar = 0,
	.fat = 2,
	.cholesterol = 0,
	.vitamin_a = 0,
	.vitamin_c = 0
  };

  cooltype corn = {
	.name = "corn",
	.type = "grain",
	.nutrition = 20,
	.nutrition_values = g_corn,
	.quantity = 1,
	.time = 0

  };
  struct nutrition_fields g_millet = {
	.calories = 189,
	.protein = 5.5,
	.sugar = 0,
	.fat = 2,
	.cholesterol = 0,
	.vitamin_a = 0,
	.vitamin_c = 0
  };

  cooltype millet = {
	.name = "millet",
	.type = "grain",
	.nutrition = 45,
	.nutrition_values = g_millet,
	.quantity = 1,
	.time = 0

  };
  struct nutrition_fields g_oats = {
	.calories = 152,
	.protein = 6.5,
	.sugar = 0,
	.fat = 2.75,
	.cholesterol = 0,
	.vitamin_a = 0,
	.vitamin_c = 0
  };

  cooltype oats = {
 	.name = "oats",
	.type = "grain",
	.nutrition = 42,
	.nutrition_values = g_oats,
	.quantity = 1,
	.time = 0

  };
  struct nutrition_fields g_rice = {
	.calories = 171,
	.protein = 3.75,
	.sugar = 0,
	.fat = 1.25,
	.cholesterol = 0,
	.vitamin_a = 0,
	.vitamin_c = 0
  };

  cooltype rice = {
	.name = "rice",
	.type = "grain",
	.nutrition = 35,
	.nutrition_values = g_rice,
	.quantity = 1,
	.time = 0

  };

  struct nutrition_fields g_rye = {
	.calories = 142,
	.protein = 6.25,
	.sugar = 0,
	.fat = 1,
	.cholesterol = 0,
	.vitamin_a = 0,
	.vitamin_c = 0
  };

  cooltype rye = {
	.name = "rye",
	.type = "grain",
	.nutrition = 50,
	.nutrition_values = g_rice,
	.quantity = 1,
	.time = 0

  };

  struct nutrition_fields g_spelt = {
	.calories = 140,
	.protein = 6,
	.sugar = 0,
	.fat = 1,
	.cholesterol = 0,
	.vitamin_a = 0,
	.vitamin_c = 0
  };

  cooltype spelt = {
	.name = "spelt",
	.type = "grain",
	.nutrition = 50,
	.nutrition_values = g_spelt,
	.quantity = 1,
	.time = 0

  };
  struct nutrition_fields g_wheat = {
	.calories = 158,
	.protein = 7.5,
	.sugar = 0,
	.fat = 1,
	.cholesterol = 0,
	.vitamin_a = 0,
	.vitamin_c = 0
  };

  cooltype wheat = {
	.name = "wheat",
	.type = "grain",
	.nutrition = 50,
	.nutrition_values = g_wheat,
	.quantity = 1,
	.time = 0

  };
    	int varsz = sizeof(cooltype);
	table_insert(*g_table,"barley", FGROUP, &barley, varsz);
	table_insert(*g_table,"corn", FGROUP, &corn, varsz);
	table_insert(*g_table,"millet", FGROUP, &millet, varsz);
	table_insert(*g_table,"oats", FGROUP, &oats, varsz);
	table_insert(*g_table,"rice", FGROUP, &rice, varsz);
	table_insert(*g_table,"rye", FGROUP, &rye, varsz);
	table_insert(*g_table,"spelt", FGROUP, &spelt, varsz);
	table_insert(*g_table,"wheat", FGROUP, &wheat, varsz);

 }
#endif
